<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!-- 下面的图片访问的都是虚拟路劲，是在tomcat里边配置好的，真实路径在tomcat里边的Host标签下的Context标签下的docBase标签下 -->
<script type="text/javascript">
	$(function(){
		$.getJSON('${pageContext.request.contextPath}/adpic/list.html',function(result){
			var adpicList = result.adpicList;
			for(var i=0;i<adpicList.length;i++){
				if(i==0){
					var indicator = " <li data-target='#myCarousel' data-slide-to='0' class='active'></li> ";
					var adpic = " <div class='item active'> "+
	        		" <img src='/userImages/carousel/"+adpicList[0].image+ "' alt='slide'>"+
		        	" </div> ";
				}else{
					var indicator = " <li data-target='#myCarousel' data-slide-to='0'></li> ";
					var adpic = " <div class='item'> "+
	        		" <img src='/userImages/carousel/"+adpicList[i].image+ "' alt='slide'>"+
		        	" </div> ";
				}
				$(".carousel-indicators").append(indicator);
				$(".carousel-inner").append(adpic);
			}
		});
	});
</script>

<div id="myCarousel" class="carousel slide">
	<!-- 轮播（Carousel）指标 -->
	<ol class="carousel-indicators">
		<!-- <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
		<li data-target="#myCarousel" data-slide-to="1"></li>
		<li data-target="#myCarousel" data-slide-to="2"></li> -->
	</ol>   
	<!-- 轮播（Carousel）项目 -->
	<div class="carousel-inner">
	
		<%-- <div class="item">
			<img src="${pageContext.request.contextPath}/static/userImages/carousel/${adpic.image}" alt="slide">
		</div> --%>
		
	</div>
	<!-- 轮播（Carousel）导航   data-slide="prev">&lsaquo;   data-slide="next">&rsaquo;-->
	<a class="carousel-control left" href="#myCarousel"  data-slide="prev">
	   </a>
	<a class="carousel-control right" href="#myCarousel" data-slide="next">
	   </a>
</div>